package org.zephyr.struct.flyweight;

/**
 * 具体享元角色
 */
public class FlyweightImpl implements Flyweight{
    private String key;

    FlyweightImpl(String key){
        this.key=key;
        System.out.println("具体享元"+key+"被创建");
    }
    @Override
    public void operation(User user) {
        System.out.println("具体享元"+key+"被调用");
        System.out.println("非享元信息是:"+user.getInfo());
    }
}
